import request from '@/utils/request'

export const getDeparments = () => {
  return request({
    url: '/company/department'
  })
}

export const delDeparments = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

export const addDeparments = (data) => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export const getDeparmentsDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

export const editDeparment = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
